<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>~/itimer/src/waitedTime.vhd.html</title>
<meta name="Generator" content="Vim/7.2">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000"><font face="monospace">
<font color="#00008b">----------------------------------------------------------------------------------</font><br>
<font color="#00008b">-- Company: </font><br>
<font color="#00008b">-- Engineer: </font><br>
<font color="#00008b">-- </font><br>
<font color="#00008b">-- Create Date:&nbsp;&nbsp;&nbsp;&nbsp;12:32:50 04/27/2009 </font><br>
<font color="#00008b">-- Design Name: </font><br>
<font color="#00008b">-- Module Name:&nbsp;&nbsp;&nbsp;&nbsp;waitedTime - Behavioral </font><br>
<font color="#00008b">-- Project Name: </font><br>
<font color="#00008b">-- Target Devices: </font><br>
<font color="#00008b">-- Tool versions: </font><br>
<font color="#00008b">-- Description: </font><br>
<font color="#00008b">--</font><br>
<font color="#00008b">-- Dependencies: </font><br>
<font color="#00008b">--</font><br>
<font color="#00008b">-- Revision: </font><br>
<font color="#00008b">-- Revision 0.01 - File Created</font><br>
<font color="#00008b">-- Additional Comments: </font><br>
<font color="#00008b">--</font><br>
<font color="#00008b">----------------------------------------------------------------------------------</font><br>
<font color="#a52a2a"><b>library</b></font>&nbsp;IEEE<font color="#6a5acd">;</font><br>
<font color="#a52a2a"><b>use</b></font>&nbsp;IEEE<font color="#6a5acd">.</font>STD_LOGIC_1164<font color="#6a5acd">.</font><font color="#a52a2a"><b>ALL</b></font><font color="#6a5acd">;</font><br>
<font color="#a52a2a"><b>use</b></font>&nbsp;IEEE<font color="#6a5acd">.</font>STD_LOGIC_ARITH<font color="#6a5acd">.</font><font color="#a52a2a"><b>ALL</b></font><font color="#6a5acd">;</font><br>
<font color="#a52a2a"><b>use</b></font>&nbsp;IEEE<font color="#6a5acd">.</font>STD_LOGIC_UNSIGNED<font color="#6a5acd">.</font><font color="#a52a2a"><b>ALL</b></font><font color="#6a5acd">;</font><br>
<br>
<font color="#00008b">---- Uncomment the following library declaration if instantiating</font><br>
<font color="#00008b">---- any Xilinx primitives in this code.</font><br>
<font color="#00008b">--library UNISIM;</font><br>
<font color="#00008b">--use UNISIM.VComponents.all;</font><br>
<br>
<font color="#a52a2a"><b>entity</b></font>&nbsp;waitedTime <font color="#a52a2a"><b>is</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>Port</b></font>&nbsp;<font color="#6a5acd">(</font>&nbsp;clockInput <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#a52a2a"><b>in</b></font>&nbsp;&nbsp;<font color="#2e8b57"><b>STD_LOGIC</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reStartTime <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#a52a2a"><b>in</b></font>&nbsp;&nbsp;<font color="#2e8b57"><b>STD_LOGIC</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; busWaitedTime <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#a52a2a"><b>out</b></font>&nbsp;&nbsp;<font color="#2e8b57"><b>STD_LOGIC_VECTOR</b></font>&nbsp;<font color="#6a5acd">(</font><font color="#ff00ff">11</font>&nbsp;<font color="#a52a2a"><b>downto</b></font>&nbsp;<font color="#ff00ff">0</font><font color="#6a5acd">));</font><br>
<font color="#a52a2a"><b>end</b></font>&nbsp;waitedTime<font color="#6a5acd">;</font><br>
<br>
<font color="#a52a2a"><b>architecture</b></font>&nbsp;Behavioral <font color="#a52a2a"><b>of</b></font>&nbsp;waitedTime <font color="#a52a2a"><b>is</b></font><br>
<font color="#a52a2a"><b>SIGNAL</b></font>&nbsp;tempMyrioSeconde<font color="#6a5acd">,</font>tempMilliSeconde<font color="#2e8b57"><b>:</b></font><font color="#2e8b57"><b>INTEGER</b></font><font color="#2e8b57"><b>:=</b></font><font color="#ff00ff">0</font><font color="#6a5acd">;</font><br>
<font color="#a52a2a"><b>begin</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;waitedTimePr<font color="#2e8b57"><b>:</b></font><font color="#a52a2a"><b>PROCESS</b></font><font color="#6a5acd">(</font>clockInput<font color="#6a5acd">)</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>BEGIN</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>IF</b></font>&nbsp;rising_edge<font color="#6a5acd">(</font>clockInput<font color="#6a5acd">)</font>&nbsp;<font color="#a52a2a"><b>THEN</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>IF</b></font>&nbsp;reStartTime <font color="#2e8b57"><b>=</b></font>&nbsp;<font color="#ff00ff">'1'</font>&nbsp;<font color="#a52a2a"><b>THEN</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempMilliSeconde <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">0</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempMyrioSeconde <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">1</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;busWaitedTime <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">&quot;000000000000&quot;</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>ELSE</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>IF</b></font>&nbsp;tempMyrioSeconde <font color="#2e8b57"><b>=</b></font>&nbsp;<font color="#ff00ff">10</font>&nbsp;<font color="#a52a2a"><b>THEN</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempMilliSeconde <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;tempMilliSeconde<font color="#2e8b57"><b>+</b></font><font color="#ff00ff">1</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempMyrioSeconde <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">1</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;busWaitedTime <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;conv_std_logic_vector<font color="#6a5acd">(</font>tempMilliSeconde<font color="#2e8b57"><b>+</b></font><font color="#ff00ff">1</font><font color="#6a5acd">,</font>&nbsp;<font color="#ff00ff">12</font><font color="#6a5acd">);</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>ELSE</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempMyrioSeconde <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;tempMyrioSeconde <font color="#2e8b57"><b>+</b></font>&nbsp;<font color="#ff00ff">1</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;busWaitedTime <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;conv_std_logic_vector<font color="#6a5acd">(</font>tempMilliSeconde<font color="#6a5acd">,</font>&nbsp;<font color="#ff00ff">12</font><font color="#6a5acd">);</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>END</b></font>&nbsp;<font color="#a52a2a"><b>IF</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>END</b></font>&nbsp;<font color="#a52a2a"><b>IF</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>IF</b></font>&nbsp;tempMilliSeconde <font color="#2e8b57"><b>&gt;</b></font>&nbsp;<font color="#ff00ff">4000</font>&nbsp;<font color="#a52a2a"><b>THEN</b></font>&nbsp;<font color="#00008b">-- Reset</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempMilliSeconde <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">0</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>END</b></font>&nbsp;<font color="#a52a2a"><b>IF</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>END</b></font>&nbsp;<font color="#a52a2a"><b>IF</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>END</b></font>&nbsp;<font color="#a52a2a"><b>PROCESS</b></font>&nbsp;waitedTimePr<font color="#6a5acd">;</font><br>
<br>
<font color="#a52a2a"><b>end</b></font>&nbsp;Behavioral<font color="#6a5acd">;</font><br>
</font></body>
</html>
